-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Security Solution][Case] Add in-progress
status to case
#84321
Conversation
x-pack/plugins/security_solution/public/cases/components/all_cases/columns.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/cases/components/all_cases/status_filter.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/cases/components/all_cases/status_filter.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/cases/components/case_action_bar/index.tsx
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/cases/components/status/button.tsx
Show resolved
Hide resolved
|
||
interface LabelTitle { | ||
action: CaseUserActions; | ||
field: string; | ||
} | ||
|
||
const getStatusTitle = (status: CaseStatus) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we could make a component from that function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because If I create a component from that I should do it for every title I think is best to do it as a tech dept on another PR.
x-pack/plugins/security_solution/public/cases/containers/mock.ts
Outdated
Show resolved
Hide resolved
309bada
to
65f591d
Compare
@elasticmachine merge upstream |
x-pack/plugins/security_solution/public/cases/components/status/config.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/cases/containers/mock.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/cases/components/all_cases/index.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/cases/components/all_cases/table_filters.tsx
Outdated
Show resolved
Hide resolved
<EuiContextMenuItem | ||
key={status} | ||
icon={status === currentStatus ? 'check' : 'empty'} | ||
onClick={onContextMenuItemClick(status)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onClick={onContextMenuItemClick(status)} | |
onClick={() => onContextMenuItemClick(status)} |
need to make this an anon/lambda function or onContextMenuItemClick
will get invoked on render for each menu item
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onContextMenuItemClick
function returns another function that is memoized
along with the status. This is a trick to avoid the callback and potential rerenders.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome!! bookmarking this for the future ;)
30f1f39
to
9c89f76
Compare
const [nextStatusIndex, setNextStatusIndex] = useState(getNextItem(indexOfCurrentStatus)); | ||
|
||
// The useEffect is needed to update status updates from the context menu. | ||
useEffect(() => setNextStatusIndex(getNextItem(indexOfCurrentStatus)), [indexOfCurrentStatus]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const [nextStatusIndex, setNextStatusIndex] = useState(getNextItem(indexOfCurrentStatus)); | |
// The useEffect is needed to update status updates from the context menu. | |
useEffect(() => setNextStatusIndex(getNextItem(indexOfCurrentStatus)), [indexOfCurrentStatus]); | |
const nextStatusIndex = useMemo(() => getNextItem(indexOfCurrentStatus), [indexOfCurrentStatus]); |
This should work, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or not because of your onClick?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or does onStatusChanged
change the indexOfCurrentStatus
which would update the useMemo
??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The onClick
needs the state. onStatusChanged
does not change the indexOfCurrentStatus
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wrong. It can be done as you said!
f754a6f
to
9db8736
Compare
|
||
// The useEffect is needed to update status updates from the context menu. | ||
useEffect(() => setNextStatusIndex(getNextItem(indexOfCurrentStatus)), [indexOfCurrentStatus]); | ||
const nextStatusIndex = useMemo(() => getNextItem(indexOfCurrentStatus), [indexOfCurrentStatus]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! LGTM. Thanks for making those changes. I've had it on my to do list to strictly type status since the start. Great work @cnasikas 🚀 🎸
💚 Build SucceededMetrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
Summary
This PR adds the
in-progress
status to cases and changes the UI to accommodate the new change. Specifically:Case single page view
Before:
After:
Mark in progress
.Demo
All cases view
Demo
Checklist
Delete any items that are not applicable to this PR.
For maintainers